package com.sg.business.commons.labelprovider.work;

import com.mobnut.commons.util.file.FileUtil;
import com.mobnut.db.model.PrimaryObject;
import com.sg.business.commons.labelprovider.linestyle.LineStyleHtmlLabel;
import com.sg.business.model.Work;
import com.sg.business.resource.BusinessResource;

public class MileStoneHtmlLabel extends LineStyleHtmlLabel {

	@Override
	public String getHtmlText(PrimaryObject po) {
		StringBuffer sb = new StringBuffer();
		boolean isMilestone = ((Work)po).isMilestone();
		if(isMilestone){
			sb.append("<img src='"); //$NON-NLS-1$
			sb.append(FileUtil.getImageURL(
					BusinessResource.IMAGE_FLAG_24,
					BusinessResource.PLUGIN_ID, BusinessResource.IMAGE_FOLDER));
			sb.append("' style='border-style:none;position:absolute; left:0; top:4; display:block;' width='16' height='16' /> "); //$NON-NLS-1$
		}
		return sb.toString();
	}
}
